home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / PageMakerClassLibrary / Queries / PGetPrivateData.cpp < prev    next >
C/C++ Source or Header  |  1996-08-15  |  2KB  |  56 lines

  1. /*
  2.  *--- PGetPrivateData.cpp -------------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Thu, Oct 12, 1995 @ 10:43 PM by Paul Ferguson.
  5.  *
  6.  * Description:  For notes about this class, refer to the
  7.  * PCL documentation file PGetPrivateData.html
  8.  *-------------------------------------------------------------------------
  9.  */
  10. #include <string.h>
  11. #ifdef MACINTOSH
  12.     #include <exception.h>
  13. #endif MACINTOSH
  14.  
  15. #include "PMCQErrs.h"
  16. #include "PGetPrivateData.h"
  17. #include "PQuery.h"
  18. #include "PRequestBuf.h"
  19. #include "PReplyBuf.h"
  20.  
  21. PGetPrivateData::PGetPrivateData
  22.   (    const char * sDeveloperID,
  23.     const char * sPluginID,
  24.     short cTargetClass,
  25.     unsigned long nTypeFlag,
  26.     unsigned long nTargetID )
  27.     
  28. : PHandleQuery()
  29.  
  30. {
  31.     if (strlen(sDeveloperID) != 4 || strlen(sPluginID) != 4)
  32.         throw CQ_INVALID_CQ_ARG;
  33.         
  34.     PRequestBuf request(100);        // plenty big to hold everything.
  35.     request    << sDeveloperID
  36.             << sPluginID
  37.             << cTargetClass
  38.             << nTypeFlag
  39.             << nTargetID;
  40.     
  41.     // NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE! NOTE!
  42.     //   If the object has no private data, an exception
  43.     //   (CQ_NOPDATA) will be thrown.  If you don't want
  44.     //   your plug-in to fail, you must handle the exception.
  45.     PQuery query(pm_getprivatedata, request, itsHandle);
  46.     InitHandle();
  47.     
  48.     PReplyBuf reply(replyPtr);
  49.  
  50.     long temp;
  51.     reply >> nSize >> cPlatform >> temp;
  52.     hPrivateData = (PMHandle) temp;
  53. }
  54.  
  55. // end of PGetPrivateData.cpp
  56.